import sympy as sp
from sympy import symbols, integrate, sqrt, atan, sin, cos

# 例1：求解 ∫√(2x+1) dx
print("例1：求解 ∫√(2x+1) dx")
x, a = symbols('x a', real=True, positive=True)
expr1 = sqrt(2*x + 1)
result1 = integrate(expr1, x)
print(f"积分结果：{result1}")

# 例2：求解 ∫1/(a²+x²) dx
print("\n例2：求解 ∫1/(a²+x²) dx")
expr2 = 1/(a**2 + x**2)
integral_result = integrate(expr2, x)
print(f"积分结果：{integral_result}")